<template></template>

<script>
import axios from "axios";
export default {
    setup() {
        let key = "13738feec1ed40d7b3e3023febf50c6f";
        let reqUrl = `https://devapi.qweather.com/v7/weather/now?key=${key}&location=113.92264,22.492387`;
        const reqFun = (reqs) => {
            let reqIndex = 0;
            const loopReq = (req) => {
                req().then(() => {
                    reqIndex++;
                    console.log(`第${reqIndex}个请求完成`);
                    if (reqIndex >= reqs.length) return;
                    loopReq(reqs[reqIndex]);
                });
            };
            loopReq(reqs[reqIndex]);
        };
        reqFun(new Array(10).fill(null).map((item) => () => axios(reqUrl)));
    },
};
</script>

<style></style>
